var assert = require('assert');
var should = require('should');
var util = require('util');
var _ = require('lodash');
var friendModel = require('../../app/models/friendModel');
var config = require('../config');

suite('测试friendModel', function () {
    var friend_model;
    setup(function (done) {
        friendModel.getByRoleId(config.role_id, function (err, model) {
            assert.equal(err == null, true);
            friend_model = model;
            done();
        });
    });

    suite('isFriend', function () {
        test('获取是否是好友', function () {
            friend_model.getFriend(1000);
        });
    });

    suite('addFriend', function () {
        test('添加好友', function () {
            friend_model.addFriend(1000);
        });
    });

    suite('removeFriend', function () {
        test('删除好友', function () {
            friend_model.addFriend(1000);
            friend_model.removeFriend(1000);
        });
    });

    suite('isFriendRequest', function () {
        test('是否有该好友的请求', function () {
            friend_model.isFriendRequest(1000);
        });
    });

    suite('acceptFriend', function () {
        test('同意好友请求', function () {
            friend_model.acceptFriend(1000);
        });
    });

    suite('addRequest', function () {
        test('增加好友请求', function () {
            friend_model.addRequest(1000);
        });
    });

    suite('removeRequest', function () {
        test('移除好友请求', function () {
            friend_model.removeRequest(1000);
        });
    });

    suite('isSendEnergy', function () {
        test('是否好友有赠送体力', function () {
            friend_model.isSendEnergy(1000);
        });
    });

    suite('sendEnergy', function () {
        test('给好友赠送体力', function () {
            friend_model.sendEnergy(1000);
        });
    });

    suite('removePresent', function () {
        test('移除好友的赠送体力', function () {
            friend_model.removePresent(1000);
        });
    });
});
